package com.yanwq.sayhi.rest;

import com.yanwq.sayhi.exception.ExResponse;
import com.yanwq.sayhi.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;

/**
 * 作者：闫伟强。
 * 日期：2016/6/21。
 */
@RestController
public class BaseRest {

    @Autowired
    private UserService userService;

    public void validateToken(String token) {
        if (!userService.validateToken(token)) {
            throw new ExResponse(1111, "登陆已失效");
        }
    }
}
